package com.smedi.ismedi.constructionproject.core.domain.repository;

import com.smedi.ismedi.constructionproject.core.domain.aggregatemodel.ProjectAssignment;
import com.smedi.ismedi.constructionproject.core.domain.aggregatemodel.dto.ProjectAssignmentQuery;

import java.util.List;

/**
 * @Author: xulinjun
 * @Date: 2021-6-8 10:56
 */
public interface ProjectAssignmentRepository {
    ProjectAssignment selectByProjectAssignmentId(Long projectAssignmentId);

    ProjectAssignment doInsert(ProjectAssignment projectAssignment);

    ProjectAssignment doUpdate(ProjectAssignment projectAssignment);

    int selectCountByPersonIdAndProjectIdAndProjectOrganizationId(Long personId, Long projectId, Long projectOrganizationId);

    void doDelete(Long projectAssignmentId);

    List<Long> selectPersonIdsByProjectId(Long projectId);

    List<Long> selectPersonIdsByProjectIdNoToken(Long projectId);

    List<ProjectAssignment> selectProjectAssignmentsByPersonId(Long personId);

    List<ProjectAssignment> selectProjectAssignmentsByPersonIds(List<Long> personIds);

    List<ProjectAssignment> selectProjectAssignmentsByPersonIdSkipSql(Long personId);

    void doDeleteByPersonIdAndProjectId(Long personId,Long projectId);

    void doDeleteByPersonId(Long personId);

    int selectCountByProjectOrganizationId(Long projectOrganizationId);

    void doDeleteByProjectId(Long projectId);

    List<ProjectAssignment> selectProjectAssignmentByProjectOrganizationId(Long projectOrganizationId);

    List<ProjectAssignment> getProjectAssignmentList(ProjectAssignmentQuery projectAssignmentQuery);

    List<ProjectAssignment> getProjectAssignmentListWithoutToken(ProjectAssignmentQuery projectAssignmentQuery);

    List<ProjectAssignment> selectByProjectId(Long projectId);

    void saveProjectAssignment(ProjectAssignment projectAssignment);
}
